package InterfaceMahasiswa;

import InterfaceStaff.*;
import java.sql.SQLException;
import java.util.List;
import java.util.logging.*;
import javax.swing.*;
import javax.swing.plaf.metal.MetalLookAndFeel;

public class FormMengisiPresensi extends javax.swing.JFrame {

    /*
     * method dibawah digunakan untuk membuat komponen menjadi disable.
     */
    private void MatikanTombol() {
        NIM.setEditable(false);
        NamaScan.setEditable(false);
        hadir.setEditable(false);
        thadir.setEditable(false);
        total.setEditable(false);
        OK.setEnabled(false);
    }

    /*
     * konstruktor berisi setting pertama persensi pada saat program dijalankan
     */
    public FormMengisiPresensi() {
        try {
            initComponents();
            List<Mahasiswa> mhs = (List<Mahasiswa>) InterfaceStaff.Presensi.getKoneksi().getAllMahasiswaPresensi();
            PresensiModelMahasiswa model = new PresensiModelMahasiswa(mhs);
            TPresensi.setModel(model);
        } catch (Exception e) {
            Logger.getLogger(FormMengisiPresensi.class.getName()).log(Level.SEVERE, null, e);
        }

        getComboboxMakul();
        getComboboxPengampu();
        setTitle("Form Presensi");
        setResizable(false);
        NIM.requestFocus();
        MatikanTombol();

    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel2 = new javax.swing.JPanel();
        jPopupMenu1 = new javax.swing.JPopupMenu();
        jPopupMenu2 = new javax.swing.JPopupMenu();
        jCheckBoxMenuItem1 = new javax.swing.JCheckBoxMenuItem();
        jCheckBoxMenuItem2 = new javax.swing.JCheckBoxMenuItem();
        popupMenu1 = new java.awt.PopupMenu();
        jLabel3 = new javax.swing.JLabel();
        namaMhs = new javax.swing.JTextField();
        jButton1 = new javax.swing.JButton();
        jPanel4 = new javax.swing.JPanel();
        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        TPresensi = new javax.swing.JTable();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        makul = new javax.swing.JComboBox();
        pengampu = new javax.swing.JComboBox();
        Buka = new javax.swing.JButton();
        jPanel5 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        NIM = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        NamaScan = new javax.swing.JTextField();
        OK = new javax.swing.JButton();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        hadir = new javax.swing.JTextField();
        thadir = new javax.swing.JTextField();
        total = new javax.swing.JTextField();

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE)
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE)
        );

        jCheckBoxMenuItem1.setSelected(true);
        jCheckBoxMenuItem1.setText("jCheckBoxMenuItem1");

        jCheckBoxMenuItem2.setSelected(true);
        jCheckBoxMenuItem2.setText("jCheckBoxMenuItem2");

        popupMenu1.setLabel("popupMenu1");

        jLabel3.setText("Nama Kategori");

        namaMhs.setToolTipText("Isikan Nama Kategori");
        namaMhs.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                namaMhsActionPerformed(evt);
            }
        });

        jButton1.setText("jButton1");

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE)
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE)
        );

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setBackground(new java.awt.Color(153, 153, 255));

        jPanel1.setBackground(new java.awt.Color(255, 255, 255));
        jPanel1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED, null, new java.awt.Color(204, 204, 204), null, null));

        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 18));
        jLabel1.setText("Presensi");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(50, 50, 50)
                        .addComponent(jLabel4))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(256, 256, 256)
                        .addComponent(jLabel1)))
                .addContainerGap(261, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 34, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel4))
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        TPresensi.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jScrollPane1.setViewportView(TPresensi);

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 543, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 171, Short.MAX_VALUE)
                .addContainerGap())
        );

        jLabel6.setText("Mata Kuliah");

        jLabel7.setText("Pengampu");

        Buka.setText("Buka");
        Buka.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BukaActionPerformed(evt);
            }
        });

        jPanel5.setBackground(new java.awt.Color(255, 255, 255));

        jLabel2.setText("NIM");

        NIM.setToolTipText("NIM Mahasiswa");
        NIM.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                NIMMouseClicked(evt);
            }
        });

        jLabel5.setText("Nama");

        NamaScan.setToolTipText("Nama Mahasiswa");

        OK.setText("OK");
        OK.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                OKActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGap(301, 301, 301)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel2)
                    .addComponent(jLabel5))
                .addGap(18, 18, 18)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(NamaScan)
                    .addComponent(NIM, javax.swing.GroupLayout.DEFAULT_SIZE, 133, Short.MAX_VALUE))
                .addGap(30, 30, 30)
                .addComponent(OK)
                .addContainerGap(29, Short.MAX_VALUE))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel2)
                            .addComponent(NIM, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel5)
                            .addComponent(NamaScan, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGap(22, 22, 22)
                        .addComponent(OK)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jLabel8.setText("Hadir");

        jLabel9.setText("Tidak Hadir");

        jLabel10.setText("Total Mahasiswa");

        hadir.setToolTipText("Jumlah Hadir");

        thadir.setToolTipText("Jumlah Tidak Hadir");

        total.setToolTipText("Total Mahasiswa");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup()
                .addGap(33, 33, 33)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel6)
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(pengampu, javax.swing.GroupLayout.Alignment.TRAILING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(makul, javax.swing.GroupLayout.Alignment.TRAILING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 270, Short.MAX_VALUE)
                        .addComponent(Buka)
                        .addGap(126, 126, 126))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(total, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                .addGap(2, 2, 2)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel7)
                                    .addComponent(jLabel10)
                                    .addGroup(layout.createSequentialGroup()
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabel8)
                                            .addComponent(jLabel9))
                                        .addGap(42, 42, 42)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addComponent(thadir)
                                            .addComponent(hadir, javax.swing.GroupLayout.DEFAULT_SIZE, 27, Short.MAX_VALUE))))))
                        .addContainerGap())))
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(14, 14, 14)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(makul, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel6))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel7)
                            .addComponent(pengampu, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(27, 27, 27)
                        .addComponent(Buka)))
                .addGap(44, 44, 44)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(hadir, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9)
                    .addComponent(thadir, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel10)
                    .addComponent(total, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(26, 26, 26)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void namaMhsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_namaMhsActionPerformed
    }//GEN-LAST:event_namaMhsActionPerformed

    private void NIMMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_NIMMouseClicked

        MatikanTombol();
    }//GEN-LAST:event_NIMMouseClicked

    /*
     * method dibawah merupakan perintah aksi saat tombol Buka dipilih.
     */
    private void BukaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BukaActionPerformed

        String txtCombo = makul.getSelectedItem().toString();
        MataKuliah mk = new MataKuliah();
        mk.setMakul(txtCombo);

        String txtCombo2 = pengampu.getSelectedItem().toString();
        Pengampu p = new Pengampu();
        p.setNama_pengampu(txtCombo2);

        TabelPresensi tp = new TabelPresensi();
        tp.setId_pengampu(p);
        tp.setId_matakuliah(mk);

        try {
            Presensi.getKoneksi().resetStatus();
        } catch (SQLException ex) {
            Logger.getLogger(FormMengisiPresensi.class.getName()).log(Level.SEVERE, null, ex);
        }
        try {
            List<Mahasiswa> mhs = (List<Mahasiswa>) Presensi.getKoneksi().getAllOpenPresensi(tp);
            PresensiModelMahasiswa model = new PresensiModelMahasiswa(mhs);
            TPresensi.setModel(model);
        } catch (SQLException ex) {
            Logger.getLogger(FormMengisiPresensi.class.getName()).log(Level.SEVERE, null, ex);
        }

        try {
            total.setText(Integer.toString(Presensi.getKoneksi().jumlahMahasiswa(tp)));
        } catch (SQLException ex) {
            Logger.getLogger(FormMengisiPresensi.class.getName()).log(Level.SEVERE, null, ex);
        }
        try {
            hadir.setText(Integer.toString(Presensi.getKoneksi().ambilJumlahHadir(tp)));
            thadir.setText(Integer.toString((Presensi.getKoneksi().jumlahMahasiswa(tp)) - (Presensi.getKoneksi().ambilJumlahHadir(tp))));
        } catch (SQLException ex) {
            Logger.getLogger(FormMengisiPresensi.class.getName()).log(Level.SEVERE, null, ex);
        }
        Buka.setEnabled(false);
        OK.setEnabled(true);
        makul.setEnabled(false);
        pengampu.setEnabled(false);
    }//GEN-LAST:event_BukaActionPerformed

    /*
     * method dibawah merupakan perintah aksi saat tombol OK dipilih.
     */
    private void OKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_OKActionPerformed
        String txtCombo = (String) makul.getSelectedItem();
        MataKuliah mk = new MataKuliah();
        mk.setMakul(txtCombo);

        String txtCombo2 = (String) pengampu.getSelectedItem();
        Pengampu p = new Pengampu();
        p.setNama_pengampu(txtCombo2);

        TabelPresensi tp = new TabelPresensi();
        tp.setId_pengampu(p);
        tp.setId_matakuliah(mk);

        try {
            List<Mahasiswa> mhs = (List<Mahasiswa>) Presensi.getKoneksi().getAllOpenPresensi(tp);
            PresensiModelMahasiswa model = new PresensiModelMahasiswa(mhs);
            TPresensi.setModel(model);
        } catch (SQLException ex) {
            Logger.getLogger(FormMengisiPresensi.class.getName()).log(Level.SEVERE, null, ex);
        }

        try {
            NIM.setText(Presensi.getKoneksi().ambilNim(getsNim()));
        } catch (SQLException ex) {
            Logger.getLogger(FormMengisiPresensi.class.getName()).log(Level.SEVERE, null, ex);
        }
        try {
            NamaScan.setText(Presensi.getKoneksi().ambilNama(getsNim()));
        } catch (SQLException ex) {
            Logger.getLogger(FormMengisiPresensi.class.getName()).log(Level.SEVERE, null, ex);
        }
        try {
            hadir.setText(Integer.toString(Presensi.getKoneksi().ambilJumlahHadir(tp)));
            thadir.setText(Integer.toString((Presensi.getKoneksi().jumlahMahasiswa(tp)) - (Presensi.getKoneksi().ambilJumlahHadir(tp))));
        } catch (SQLException ex) {
            Logger.getLogger(FormMengisiPresensi.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_OKActionPerformed

    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                try {
                    UIManager.setLookAndFeel(new MetalLookAndFeel());
                } catch (UnsupportedLookAndFeelException ex) {
                    Logger.getLogger(FormMengisiPresensi.class.getName()).log(Level.SEVERE, null, ex);
                }
                new FormMengisiPresensi().setVisible(true);
                tools.QRReader qr = new tools.QRReader();

                qr.memindaiQRCode();

            }
        });
    }

    /*
     * method untuk mengambil pengampu dari database dan menampilkanya dalam bentuk combobox.
     */
    public void getComboboxPengampu() {
        try {
            List<Pengampu> p = Presensi.getKoneksi().getAllPengampu();
            for (Pengampu k : p) {
                pengampu.addItem(k.getNama_pengampu());
            }
        } catch (Exception e) {
            Logger.getLogger(FormMengisiPresensi.class.getName()).log(Level.SEVERE, null, e);
        }
    }

    /*
     * method untuk mengambil mata kuliah dari database dan menampilkanya dalam bentuk combobox.
     */
    public void getComboboxMakul() {
        try {
            List<MataKuliah> m = Presensi.getKoneksi().getAllMakul();
            for (MataKuliah k : m) {
                makul.addItem(k.getMakul());
            }
        } catch (Exception e) {
            Logger.getLogger(FormMengisiPresensi.class.getName()).log(Level.SEVERE, null, e);
        }
    }

    /*
     * method dibawah digunakan untuk mengambil nim dari QRReader.
     */
    public static String tampilNim(String data) {
        setsNim(data);
        return null;
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton Buka;
    private javax.swing.JTextField NIM;
    private javax.swing.JTextField NamaScan;
    private javax.swing.JButton OK;
    private javax.swing.JTable TPresensi;
    private javax.swing.JTextField hadir;
    private javax.swing.JButton jButton1;
    private javax.swing.JCheckBoxMenuItem jCheckBoxMenuItem1;
    private javax.swing.JCheckBoxMenuItem jCheckBoxMenuItem2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPopupMenu jPopupMenu1;
    private javax.swing.JPopupMenu jPopupMenu2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JComboBox makul;
    private javax.swing.JTextField namaMhs;
    private javax.swing.JComboBox pengampu;
    private java.awt.PopupMenu popupMenu1;
    private javax.swing.JTextField thadir;
    private javax.swing.JTextField total;
    // End of variables declaration//GEN-END:variables
    private static String sNim;

    public static String getsNim() {
        return sNim;
    }

    public static void setsNim(String asNim) {
        sNim = asNim;
    }
}
